/**
 * 
 */
package org.xtense.model;

/**
 * @author Owner
 * 
 */
public class CText {
	private int elementPre;
	private String textContent;

	/**
	 * @param elementPre
	 * @param textContent
	 */
	public CText(int elementPre, String textContent) {
		super();
		this.elementPre = elementPre;
		this.textContent = textContent;
	}

	/**
	 * @return the elementPre
	 */
	public int getElementPre() {
		return elementPre;
	}

	/**
	 * @param elementPre
	 *            the elementPre to set
	 */
	public void setElementPre(int elementPre) {
		this.elementPre = elementPre;
	}

	/**
	 * @return the textContent
	 */
	public String getTextContent() {
		return textContent;
	}

	/**
	 * @param textContent
	 *            the textContent to set
	 */
	public void setTextContent(String textContent) {
		this.textContent = textContent;
	}
	
	/**
	 * Add one text to another.
	 * @param cText
	 * @return cText
	 */
	public CText combine(CText cText) {
		if( this.elementPre == cText.getElementPre() ) {
			return new CText(this.elementPre, this.textContent + cText.getTextContent());
		} else {
			return this;
		}
	}

}
